<template>
  <div id="app">
    <div class="topbg"></div>
    <div class="card">
      <div style="width:80px;height:80px;border-radius:50%;overflow:hidden;margin:10px auto">
        <img :src="myDetail.wxUrl" width="80px" height="80px">
      </div>
      <div
        style="text-align:center;font-size:20px;font-weight:600;padding:16px 0"
      >{{myDetail.wxName}}</div>
      <!--<router-link to="/complete">-->
        <div class="complete" @click="setDetail">
          <van-icon name="edit" size="16px"/>完善资料，解锁平台全部功能
        </div>
      <!--</router-link>-->
    </div>
    <div class="detail" style="padding-top:120px">
      <h3>他来自</h3>
      <div class="address">滨江区，中控集团</div>
      <div class="icon">
        <div>
          <div class="flex-center">
            <van-icon name="pending-payment" size="30px"/>
          </div>
          <div class="title">战略规划专员</div>
        </div>
        <div>
          <div class="flex-center">
            <van-icon name="label-o" size="30px"/>
          </div>
          <div class="title">173cm</div>
        </div>
        <div>
          <div class="flex-center">
            <van-icon name="user-circle-o" size="30px"/>
          </div>
          <div class="title">25岁</div>
        </div>
        <div>
          <div class="flex-center">
            <van-icon name="balance-o" size="30px"/>
          </div>
          <div class="title">10-20w</div>
        </div>
      </div>
    </div>
    <div>
      <ul>
        <li class="group">
          <h3>标签</h3>
          <div>
            <p>更容易被搜索</p>
            <button class="listBtn">添加标签</button>
          </div>
        </li>
        <li class="group">
          <h3>关于我</h3>
          <div>
            <p>可提高曝光排名</p>
            <button class="listBtn">去填写</button>
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      myDetail: {}
    };
  },
  created() {
    var openId = localStorage.getItem("openId");
    this.$http
      .get("/app/login/autoLogin?openId="+openId)
      .then(res => {
        console.log(res.data);
        this.myDetail = res.data;
      });
  },
  methods: {
      setDetail(){
          if(this.myDetail.phone != ''|| null) this.$router.push({ path: "/detailGroup"});
          else this.$router.push({ path: "/complete",query:{type:'center'}});
      },
  },
  mounted() {}
};
</script>

<style scoped>
@media screen and (max-width: 750px) {
  .complete {
    font-size: 14px;
    color: gray;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .personal {
    padding: 20px;
    border-bottom: 1px solid #f2f2f2;
  }
  .topbg {
    background: #000000;
    height: 150px;
  }

  .card {
    box-sizing: border-box;
    width: 94%;
    height: 250px;
    position: absolute;
    top: 4px;
    left: 3%;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 0 10px #ccc;
    padding: 20px;
  }
  .personal .myImg {
    width: 100px;
    display: flex;
    flex-direction: column;
  }

  .personal .myName {
    flex: 1;
    padding: 10px 0 0 20px;
  }

  .personal .myName .code {
    font-size: 12px;
    padding: 10px 0;
  }

  .personal .myImg .img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #f9f9f9;
    margin: 0 auto;
    overflow: hidden;
  }

  .personal .myImg .complete {
    font-size: 12px;
    text-align: center;
    padding: 6px 0;
  }

  .flex-between {
    display: flex;
    justify-content: space-between;
  }

  .list ul {
    display: flex;
    justify-content: space-around;
    padding-top: 20px;
  }

  .list ul h5 {
    color: #333333;
    text-align: center;
  }

  .list ul p {
    font-size: 12px;
    color: #888888;
    text-align: center;
    padding: 4px 0;
  }

  .myMoving {
    padding: 20px 10px;
    border-bottom: 1px solid #f2f2f2;
    padding-top: 104px;
  }

  .myMoving > div {
    padding: 30px 0;
  }

  .myMoving > div > p {
    color: gray;
    font-size: 10px;
    padding: 6px 0;
    text-align: center;
  }

  .myMoving .addMoving {
    display: block;
    background: #fc3838;
    color: #ffffff;
    border: none;
    outline: none;
    padding: 4px 10px;
    border-radius: 6px;
    margin: 0 auto;
  }

  .group {
    padding: 20px 10px;
    border-bottom: 1px solid #f2f2f2;
  }

  .group p {
    font-size: 12px;
    font-weight: 300;
    padding: 6px 0;
    text-align: center;
  }
  .group > div {
    padding: 30px 0;
  }
  .group .listBtn {
    display: block;
    font-size: 12px;
    padding: 6px 16px;
    outline: none;
    background: #ffffff;
    border: 1px solid #000000;
    border-radius: 20px;
    margin: 0 auto;
  }
  .detail {
    padding: 10px 20px;
    border-bottom: 1px solid #f2f2f2;
  }

  .detail .address {
    padding: 6px 0;
    font-size: 14px;
    color: #333333;
  }
  .flex-center {
    display: flex;
    justify-content: center;
  }
  .detail .icon {
    display: flex;
    justify-content: space-around;
    padding: 20px 0;
  }
  .detail .icon > div {
    width: 22%;
    text-align: center;
  }
  .detail .icon .title {
    font-size: 14px;
    padding: 8px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
  }
}

@media screen and (min-width: 760px) {
  #app {
    display: none;
  }
}
</style>
